var rootview = ui("$");
var app = sm("do_App");
var page = sm("do_Page");
var nf = sm("do_Notification");
var openHelper = require("helper/open");
var bizzType = require("helper/bizzType");
var userUtil = require("helper/user");
var content = ui("content");
var beCommentedName = ui("beCommentedName");
var beCommentedLabel = ui("beCommentedLabel");
rootview.setMapping({   // 此处的Mapping只能设置在 RootView 上 ;
    "userImg.source" : "creatorImg",
    "userImg.tag" : "creatorId",
    "userName.text" : "creatorName",
    "content.text" : "content",
    "createTime.text" : "dayMinutesNewAt",
    "beCommentedLabel.visible":"beCommented",
    "beCommentedName.text":"beCommentedName",
    "content.tag":"id",
    "commentAlayout.tag":"bizzId",
    "do_LinearLayout_3.tag":"bizzType"
});

//点击个人头像-他的人个主页
ui("do_ALayout_userImg").on("touch", function(data, e) {
	var userId = ui("userImg").tag;
	if(userId !=null){
		openHelper.openPersonal(userId);
	}
});

//回复评论
ui("commentAlayout").on("touch", function(data, e) {
	if(ui("userImg").tag != userUtil.userId()){
		var param = {
			showSendText:true,
			beCommentedId:ui("content").tag,
			beCommentedName:ui("userName").text,
			bizzId:ui("commentAlayout").tag,
			bizzType:ui("do_LinearLayout_3").tag
		};
		page.fire("bottomShow",param);
	}
});
